package com.hk.daoimple;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.hk.dao.BoardDAO;
import com.hk.dtos.BoardDTO;

public class BoardDAOImple
		extends SqlMapClientDaoSupport
				implements BoardDAO{
	
	@SuppressWarnings("unchecked")
	@Override
	public List<BoardDTO> getBoardList() {
		
		return this.getSqlMapClientTemplate().
					queryForList("boardmap.getBoardList");
	}

	@Override
	public void insertBoard(BoardDTO dto) {
		// TODO Auto-generated method stub
		this.getSqlMapClientTemplate().insert("boardmap.insertBoard", dto);
	}

	@Override
	public BoardDTO getBoard(BoardDTO dto) {
		// TODO Auto-generated method stub
		return (BoardDTO)this.getSqlMapClientTemplate().queryForObject("boardmap.getBoard",dto);
	}

	@Override
	public int updateBoard(BoardDTO dto) {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().update("boardmap.updateBoard", dto);
	}

	@Override
	public int deleteBoard(BoardDTO dto) {
		// TODO Auto-generated method stub
		return this.getSqlMapClientTemplate().delete("boardmap.deleteBoard", dto);
	}	
}
